<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="24" >
                <el-form-item  label="物品名称"
 prop="goodsname" >
                        <p>{{dataForm.goodsname}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="物品属性"
 prop="parameter" >
                        <p>{{dataForm.parameter}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="规格型号"
 prop="goodsunit" >
                        <p>{{dataForm.goodsunit}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="物品类型"
 prop="goodstype" >
                        <p>{{dataForm.goodstype}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="物品类别"
 prop="goodscategory" >
                        <p>{{dataForm.goodscategory}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="物品价格"
 prop="price" >
                        <p>{{dataForm.price}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="库存数量"
 prop="storeamount" >
                        <p>{{dataForm.storeamount}}</p>
                </el-form-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            goodsname : '',
                            parameter : '',
                            goodsunit : '',
                            goodstype : "",
                            goodscategory : "",
                            price : '',
                            storeamount : '',
                            useamount : '',
            },
                       goodscategoryProps:{"children":"children","label":"fullName","value":"id"},

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/goods/BusGoods/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
